//节流
function throttle(fn, delay) {
  let last = 0; // 记录上次触发时间
  return function (...args) {
    //拿到现在时间
    const now = Date.now(); // console.log('now', now); //进行判定
    if (now - last > 3000) {
      last = now;
      fn.apply(this, args);
    }
  };
}

export { throttle };
